package com.xiaolin.ssosystem.config;

import com.google.common.util.concurrent.RateLimiter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author xiaolin
 * @description 描述
 * @since 2024/10/18
 */
@Configuration
public class RateLimiterConfig {

    @Bean
    public RateLimiter rateLimiter() {
        // 每秒允许1000个请求
        return RateLimiter.create(1000.0);
    }
}
